class Person(object):
    __slots__ = ('_name', '_age', '_gender')  #这个类只能绑定这几个属性

    def __init__(self, name, age):
        self._name = name
        self._age = age

    @property
    def name(self):
        return self._name

    @property
    def age(self):
        return self._age

    @age.setter
    def age(self, age):
        self._age = age

    def play(self):
        if self._age >= 18:
            print("恭喜你 %s 你以成年" % self._name)
        else:
            print("对不起，%s 你还没有成年" % self._name)


def main():
    p = Person('王大锤', 19, 18)
    p.play()
    p._age = 12
    p._gender = '男'
    p.size = 12


if __name__ == '__main__':
    main()
